home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Demos
/
Bowers Development
/
AppMaker 2.0b5
/
Examples
/
TCL
/
AMReminder
/
MainWindow.cp
< prev
next >
Wrap
Text File
|
1996-03-19
|
3KB
|
161 lines
/* MainWindow.cp -- window methods */
/* Created 01/01/95 12:01 PM by AppMaker */
/* This module overrides the AppMaker-generated code in zMainWindow. */
/* It provides a place for you to add your own code and still be able to */
/* generate code for new changes to the user interface. This module will */
/* not be regenerated by AppMaker unless you delete it. Its superclass, */
/* zMainWindow, may be regenerated to handle user interface changes */
/* without losing your hand-coded changes to this module. */
#include <Commands.h>
#include <CBartender.h>
#include <CDecorator.h>
#include <CDirector.h>
#include <TBUtilities.h>
#include <CPicture.h>
#include <CAMStaticText.h>
#include <CAMBorder.h>
#include <CScrollPane.h>
#include <CAMArrayPane.h>
#include <CAMButton.h>
#include "CmdCodes.h"
#include "Add.h"
#include "Add.h"
#include "AMReminderData.h"
#include "MainWindow.h"
extern CBartender *gBartender; /* The menu handling object */
extern CDecorator *gDecorator; /* Window dressing object */
/*----------*/
void CMainWindow::IMainWindow (CDirector *aSupervisor,
CAMReminderData *theData)
{
itsData = theData;
inherited::IZMainWindow (aSupervisor);
gDecorator->StaggerWindow (this);
// any additional initialization for your window
} /* IMainWindow */
/*----------*/
void CReminders::IViewTemp (CView *anEnclosure,
CBureaucrat *aSupervisor,
Ptr viewData)
{
inherited::IViewTemp (anEnclosure, aSupervisor, viewData);
// any additional initialization for your subclass
AddRow (4, 0); // e.g., add 4 rows at the beginning of the list
} /* IViewTemp */
/*----------*/
void CReminders::GetCellText (Cell aCell,
short availableWidth,
StringPtr itsText)
{
// replace with your own code which uses the cell coordinates
// to access your private data structures,
// then convert the cell data to a Str255
switch (aCell.v) {
case 0:
CopyPString ("\pOne", itsText);
break;
case 1:
CopyPString ("\pTwo", itsText);
break;
case 2:
CopyPString ("\pThree", itsText);
break;
default:
CopyPString ("\pInfinity", itsText);
break;
}; /* switch */
} /* GetCellText */
/*----------*/
// This overrides the parent's NewReminders to create a subclass of CAMArrayPane
CAMArrayPane *CMainWindow::NewReminders (void)
{
CReminders *theList;
theList = new CReminders;
return (theList);
} /* NewReminders */
/*----------*/
void CMainWindow::UpdateMenus (void)
{
inherited::UpdateMenus ();
gBartender->EnableCmd (cmdAddReminder);
gBartender->EnableCmd (cmdEditReminder);
gBartender->EnableCmd (cmdDeleteReminder);
} /* UpdateMenus */
/*----------*/
void CMainWindow::DoCommand (long theCommand)
{
switch (theCommand) {
case cmdAddReminder:
DoAddReminder ();
break;
case cmdEditReminder:
DoEditReminder ();
break;
case cmdDeleteReminder:
DoDeleteReminder ();
break;
default:
inherited::DoCommand (theCommand);
break;
} /* switch */
} /* DoCommand */
//----------
void CMainWindow::DoAddReminder ()
{
}
//----------
void CMainWindow::DoEditReminder ()
{
}
//----------
void CMainWindow::DoDeleteReminder ()
{
}
/*----------*/
void CMainWindow::ProviderChanged (CCollaborator *aProvider,
long reason,
void* info)
{
if (aProvider == itsReminders) {
if (itsReminders->HasSelection ()) {
// perhaps activate some buttons
} else {
// perhaps deactivate
}
}
} /* ProviderChanged */
/* MainWindow.cp */